package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

@TableName("t_shopCart")
public class ShoppingCartBean {
    /** 购物车id*/
    @TableId(value = "pk_shopCartId",type = IdType.AUTO)
    private Integer id;
    /** 用户id*/
    @TableField("fk_userId")
    private Integer userId;

    /** 商品id*/
    @TableField("fk_productId")
    private Integer productId;

    /** 购买的商品对象*/
    @TableField(exist = false)
    private ProductBean productBean;

    /** 购买数量*/
    @TableField("s_buyNum")
    private Integer buyNum;


    public ShoppingCartBean() {
    }

    public ShoppingCartBean(Integer userId, Integer productId, Integer buyNum) {
        this.userId = userId;
        this.productId = productId;
        this.buyNum = buyNum;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public ProductBean getProductBean() {
        return productBean;
    }

    public void setProductBean(ProductBean productBean) {
        this.productBean = productBean;
    }

    public Integer getBuyNum() {
        return buyNum;
    }

    public void setBuyNum(Integer buyNum) {
        this.buyNum = buyNum;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    @Override
    public String toString() {
        return "ShoppingCartBean{" +
                "id=" + id +
                ", userId=" + userId +
                ", productId=" + productId +
                ", productBean=" + productBean +
                ", buyNum=" + buyNum +
                '}';
    }
}
